<?php
require_once("../../inc/global.php");
require_once("function.php");
adminislogin();
$MenuID=$_GET["MenuID"];
$id=isset($_GET["id"])?$_GET["id"]:null; 
$allid=$_POST["delcheck"];
if(!isGetRule($MenuID,$_SESSION[ADMINSESSION][0],4) && strtolower($_SESSION[ADMINSESSION][1])!='admin'){
	YKT_error('对不起，你没有操作的权限',$_SERVER['HTTP_REFERER']);
}
//获取表名
$DataTableName=$System->GetTableName($MenuID);
if(is_numeric($id)||!empty($id)){
	$db->exec("delete from {$DataTableName} where {$DataTableName}0={$id}");
}elseif(is_array($allid)){
	$d_string='';
	for($d=0;$d<count($allid);$d++){
		$d_string.=$allid[$d];
		if($d<count($allid)-1){
			$d_string.=",";
		}
	}
	$db->exec("delete from {$DataTableName} where {$DataTableName}0 in({$d_string})");
}else{
	YKT_error('真不知道你要删除哪一条记录',$_SERVER['HTTP_REFERER']);
}
YKT_error('数据已成功删除',$_SERVER['HTTP_REFERER']);
	
?>